#ifndef __myfunc__
#define __myfunc__

#include "vari.h"  // 变量
#include "zimu.h"  // 字库
#include "time.h"  // 定时

/******************************************************************/
/*                 74HC595串行数据输入                            */
/******************************************************************/
void SendDate(uchar DataR1, uchar DataR2, bit RG) {
  for (uchar i = 8; i > 0; i--) {
    digitalWrite(CLK, 0);
    digitalWrite(DATR1, DataR1 & 0x80);
    digitalWrite(DATG1, 1);
    if (RG) {
      digitalWrite(DATR2, DataR2 & 0x80);
      digitalWrite(DATG2, 1);
    } else {
      digitalWrite(DATG2, DataR2 & 0x80);
      digitalWrite(DATR2, 1);
    }
    digitalWrite(CLK, 1);
    DataR1 <<= 1;
    DataR2 <<= 1;
    // 设置亮度
    if (MyLigth == 2 && i == 8 - 0) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 8 us
    if (MyLigth == 3 && i == 8 - 1) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 14 us
    if (MyLigth == 4 && i == 8 - 2) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 20 us
    if (MyLigth == 5 && i == 8 - 3) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 27 us
  }
}
/******************************************************************/
/*                 74HC595串行数据反向输入                            */
/******************************************************************/
void SendDateF(uchar DataR1, uchar DataR2, bit RG) {  //反向读取，上下倒置使用
  for (uchar i = 8; i > 0; i--) {
    digitalWrite(CLK, 0);
    digitalWrite(DATR2, DataR2 & 0x01);
    digitalWrite(DATG2, 1);
    if (RG) {
      digitalWrite(DATR1, DataR1 & 0x01);
      digitalWrite(DATG1, 1);
    } else {
      digitalWrite(DATG1, DataR1 & 0x01);
      digitalWrite(DATR1, 1);
    }
    digitalWrite(CLK, 1);
    DataR1 >>= 1;
    DataR2 >>= 1;
    // 设置亮度
    if (MyLigth == 2 && i == 8 - 0) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 8 us
    if (MyLigth == 3 && i == 8 - 1) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 14 us
    if (MyLigth == 4 && i == 8 - 2) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 20 us
    if (MyLigth == 5 && i == 8 - 3) { digitalWrite(EN, HUB8_OE_ON); }  // 不显示 27 us
  }
}
/******************************************************************/
/*                 自动设置时间，及亮度                             */
/******************************************************************/
void AutoSetMyLigth(bit haf) {
  if (!haf) {
    // 每半小时
    if (AUTOLIGHT) {
      MyLigth = STATE_MYLIGHT_MIN;

      for (uchar j = 0; j < 9; j++) {  // 根据当前小时时间，取得亮度值，时间必须按照大小排序
        if (l_tmpgetdate[2] >= l_tmpligth[j][0]) {
          MyLigth = l_tmpligth[j][1];
        }
      }
    }
  } else {
    // 12:30 - 14:30 暗
    if (WUXIU && l_tmpgetdate[2] >= 12 && l_tmpgetdate[2] <= 14) {
      MyLigth = l_tmpgetdate[2] == 14 ? STATE_MYLIGHT_MAX : 2;
    }
  }
}

/******************************************************************/
/*                 根据参数是否可以从网络取得时间                    */
/******************************************************************/
void GetNetworkTime() {
  NTPNOTOK = !SetRTCTime();
}

/******************************************************************/
/*           根据参数写32行显示缓存区                               */
/******************************************************************/
void SetDisplay(void) {
  uchar num, m, u, t, temp;
  uchar e0, e1, e2, e3, e5, e6, e7, e8, e9, e10, e11, e12, e13;
  uchar d0, d1, d2, d3, d4, d5, d6, d7, d8;
  uchar a0, a1, a2, a3, a4, a5, a6, a7;
  uchar c0, c1, c2, c3, c4, c5, c6, c7;
  bit showsh_s, showsh_z;

  l_tmpdisplayNYR[2] = l_tmpgetdate[6] / 16;    //年十位
  l_tmpdisplayNYR[3] = l_tmpgetdate[6] & 0x0f;  //年个位
  l_tmpdisplayNYR[4] = l_tmpgetdate[5] / 16;    //月十位
  l_tmpdisplayNYR[5] = l_tmpgetdate[5] & 0x0f;  //月个位
  l_tmpdisplayNYR[6] = l_tmpgetdate[4] / 16;    //日十位
  l_tmpdisplayNYR[7] = l_tmpgetdate[4] & 0x0f;  //日个位

  l_tmpdisplay[0] = l_tmpgetdate[2] / 16;    //时十位
  l_tmpdisplay[1] = l_tmpgetdate[2] & 0x0f;  //时个位
  l_tmpdisplay[2] = STATE_HUB_COLON;         //冒号
  l_tmpdisplay[3] = l_tmpgetdate[1] / 16;    //分十位
  l_tmpdisplay[4] = l_tmpgetdate[1] & 0x0f;  //分个位
  l_tmpdisplay[5] = l_tmpgetdate[3];         //星期
  l_tmpdisplay[6] = l_tmpgetdate[0] / 16;    //秒十位
  l_tmpdisplay[7] = l_tmpgetdate[0] & 0x0f;  //秒个位


  tx_i_show_row_bak = tx_i_show_row;

  // 32行扫描
  for (num = 0; num < 32; num++) {

    if (MyDisplay == STATE_MYDISPLAY_NORMAL) {  // 正常

      if (num == 30) {  // 秒进度条，在30行
        c0 = 0x00;
        c1 = 0x00;
        c2 = 0x00;
        c3 = 0x00;
        c4 = 0x00;
        c5 = 0x00;
        c6 = 0x00;
        c7 = 0x00;

        if (H > 0 && H < 64) {
          m = H / 8;
          u = H % 8;
          switch (u) {
            case 0:
              t = B10000000;  //0x80;
              break;
            case 1:
              t = B11000000;  //0xc0;
              break;
            case 2:
              t = B01100000;  //0x60;
              break;
            case 3:
              t = B00110000;  //0x30;
              break;
            case 4:
              t = B00011000;  //0x18;
              break;
            case 5:
              t = B00001100;  //0x0c;
              break;
            case 6:
              t = B00000110;  //0x06;
              break;
            case 7:
              t = B00000011;  //0x03;
              break;
          }

          switch (m) {
            case 0:
              c0 = t & B01111111;  //0x7f;
              break;
            case 1:
              if (u == 0) c0 = B00000001;  //0x01;
              c1 = t;
              break;
            case 2:
              if (u == 0) c1 = B00000001;  //0x01;
              c2 = t;
              break;
            case 3:
              if (u == 0) c2 = B00000001;  //0x01;
              c3 = t;
              break;
            case 4:
              if (u == 0) c3 = B00000001;  //0x01;
              c4 = t;
              break;
            case 5:
              if (u == 0) c4 = B00000001;  //0x01;
              c5 = t;
              break;
            case 6:
              if (u == 0) c5 = B00000001;  //0x01;
              c6 = t;
              break;
            case 7:
              if (u == 0) c6 = B00000001;  //0x01;
              c7 = t;
              break;
          }
        }
        if (MyStyte3 < 2) {
          XdataDisplayR[30][0] = c0;
          XdataDisplayR[30][1] = c1;
          XdataDisplayR[30][2] = c2;
          XdataDisplayR[30][3] = c3;
          XdataDisplayR[30][4] = c4;
          XdataDisplayR[30][5] = c5;
          XdataDisplayR[30][6] = c6;
          XdataDisplayR[30][7] = c7;
        }
      } else if (num == 31) {  // 根据N值，在最后行显示进度条
        a0 = 0x00;
        a1 = 0x00;
        a2 = 0x00;
        a3 = 0x00;
        a4 = 0x00;
        a5 = 0x00;
        a6 = 0x00;
        a7 = 0x00;

        if (N > 0 && N < 64) {
          m = N / 8;
          u = N % 8;
          switch (u) {
            case 0:
              t = 0x00;
              break;
            case 1:
              t = B10000000;  //0x80;
              break;
            case 2:
              t = B11000000;  //0xc0;
              break;
            case 3:
              t = B11100000;  //0xe0;
              break;
            case 4:
              t = B11110000;  //0xf0;
              break;
            case 5:
              t = B11111000;  //0xf8;
              break;
            case 6:
              t = B11111100;  //0xfc;
              break;
            case 7:
              t = B11111110;  //0xfe;
              break;
          }

          switch (m) {
            case 0:
              a0 = t;
              break;
            case 1:
              a0 = B11111111;  //0xff;
              a1 = t;
              break;
            case 2:
              a0 = B11111111;  //0xff;
              a1 = B11111111;  //0xff;
              a2 = t;
              break;
            case 3:
              a0 = B11111111;  //0xff;
              a1 = B11111111;  //0xff;
              a2 = B11111111;  //0xff;
              a3 = t;
              break;
            case 4:
              a0 = B11111111;  //0xff;
              a1 = B11111111;  //0xff;
              a2 = B11111111;  //0xff;
              a3 = B11111111;  //0xff;
              a4 = t;
              break;
            case 5:
              a0 = B11111111;  //0xff;
              a1 = B11111111;  //0xff;
              a2 = B11111111;  //0xff;
              a3 = B11111111;  //0xff;
              a4 = B11111111;  //0xff;
              a5 = t;
              break;
            case 6:
              a0 = B11111111;  //0xff;
              a1 = B11111111;  //0xff;
              a2 = B11111111;  //0xff;
              a3 = B11111111;  //0xff;
              a4 = B11111111;  //0xff;
              a5 = B11111111;  //0xff;
              a6 = t;
              break;
            case 7:
              a0 = B11111111;  //0xff;
              a1 = B11111111;  //0xff;
              a2 = B11111111;  //0xff;
              a3 = B11111111;  //0xff;
              a4 = B11111111;  //0xff;
              a5 = B11111111;  //0xff;
              a6 = B11111111;  //0xff;
              a7 = t;
              break;
          }
        } else if (MyStyte3 >= 2) {
          a0 = c0;
          a1 = c1;
          a2 = c2;
          a3 = c3;
          a4 = c4;
          a5 = c5;
          a6 = c6;
          a7 = c7;
        }
      } else {  // num <> 30 & num <> 31，显示主要内容
        if (MyStyte3 == STATE_MYSTYTE3_BIGNYR) {
          d0 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[0]];  //时-十位
          d1 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[0] + 1];
          d2 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[1]];  //时-个位
          d3 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[1] + 1];
          d4 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[3]];  //分-十位
          d5 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[3] + 1];
          d6 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[4]];  //分-个位
          d7 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[4] + 1];
          d8 = TableHUBALL_1[num * 2 + 48 * l_tmpdisplay[2]];  //":"
        } else if (MyStyte3 == STATE_MYSTYTE3_BIGALL) {
          d0 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[0]];  //时-十位
          d1 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[0] + 1];
          d2 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[1]];  //时-个位
          d3 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[1] + 1];
          d4 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[3]];  //分-十位
          d5 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[3] + 1];
          d6 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[4]];  //分-个位
          d7 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[4] + 1];
          d8 = TableHUBALL[num * 2 + 64 * l_tmpdisplay[2]];  //":"
        }

        XdataDisplayR[num][0] = d0;
        XdataDisplayR[num][1] = d1 | d2 >> 6;

        XdataDisplayR[num][2] = d2 << 2 | d3 >> 6;
        XdataDisplayR[num][3] = d3 << 2 | d8 >> 4;

        XdataDisplayR[num][4] = d4 >> 2 | d8 << 4;
        XdataDisplayR[num][5] = d5 >> 2 | d4 << 6;

        XdataDisplayR[num][6] = d6;
        XdataDisplayR[num][7] = d7;
      }

      // MyDisplay == STATE_MYDISPLAY_NORMAL
      showsh_s = false;

      if (MyStyte3 >= STATE_MYSTYTE3_SHEHUI3) {
        // 显示社会在上方，(从中间往上移动7行)
        if (num > 1 || num <= 17) {
          showsh_s = true;
          m = num - 1;
        }
      };

    } else {
      // MyDisplay == STATE_MYDISPLAY_DEMO, STATE_MYDISPLAY_WIFI
      showsh_z = false;

      if (num > 8 || num <= 24) {
        showsh_z = true;
        m = num - 7;  // 显示社会，(在中间)
      }
    }

    // 汉字赋值
    if (showsh_s || showsh_z) {
      if (!tx_b_show) {  // 非特效动态显示，正常显示
        XdataDisplay[m][0] = TableYanShi[m * 2 + 0 + I_display * 128];
        XdataDisplay[m][1] = TableYanShi[m * 2 + 1 + I_display * 128];
        XdataDisplay[m][2] = TableYanShi[m * 2 + 0 + 32 + I_display * 128];
        XdataDisplay[m][3] = TableYanShi[m * 2 + 1 + 32 + I_display * 128];
        XdataDisplay[m][4] = TableYanShi[m * 2 + 0 + 64 + I_display * 128];
        XdataDisplay[m][5] = TableYanShi[m * 2 + 1 + 64 + I_display * 128];
        XdataDisplay[m][6] = TableYanShi[m * 2 + 0 + 96 + I_display * 128];
        XdataDisplay[m][7] = TableYanShi[m * 2 + 1 + 96 + I_display * 128];
      } else {
        if (tx_i_show_row_bak < 16) {
          XdataDisplay[m][0] = TableYanShi[(m + tx_i_show_row) * 2 + 0 + (I_display - 1) * 128];
          XdataDisplay[m][1] = TableYanShi[(m + tx_i_show_row) * 2 + 1 + (I_display - 1) * 128];
          XdataDisplay[m][2] = TableYanShi[(m + tx_i_show_row) * 2 + 0 + 32 + (I_display - 1) * 128];
          XdataDisplay[m][3] = TableYanShi[(m + tx_i_show_row) * 2 + 1 + 32 + (I_display - 1) * 128];
          XdataDisplay[m][4] = TableYanShi[(m + tx_i_show_row) * 2 + 0 + 64 + (I_display - 1) * 128];
          XdataDisplay[m][5] = TableYanShi[(m + tx_i_show_row) * 2 + 1 + 64 + (I_display - 1) * 128];
          XdataDisplay[m][6] = TableYanShi[(m + tx_i_show_row) * 2 + 0 + 96 + (I_display - 1) * 128];
          XdataDisplay[m][7] = TableYanShi[(m + tx_i_show_row) * 2 + 1 + 96 + (I_display - 1) * 128];
        } else {
          XdataDisplay[m][0] = TableYanShi[(m + tx_i_show_row) * 2 + 0 - 32 + (I_display)*128];
          XdataDisplay[m][1] = TableYanShi[(m + tx_i_show_row) * 2 + 1 - 32 + (I_display)*128];
          XdataDisplay[m][2] = TableYanShi[(m + tx_i_show_row) * 2 + 0 - 32 + 32 + (I_display)*128];
          XdataDisplay[m][3] = TableYanShi[(m + tx_i_show_row) * 2 + 1 - 32 + 32 + (I_display)*128];
          XdataDisplay[m][4] = TableYanShi[(m + tx_i_show_row) * 2 + 0 - 32 + 64 + (I_display)*128];
          XdataDisplay[m][5] = TableYanShi[(m + tx_i_show_row) * 2 + 1 - 32 + 64 + (I_display)*128];
          XdataDisplay[m][6] = TableYanShi[(m + tx_i_show_row) * 2 + 0 - 32 + 96 + (I_display)*128];
          XdataDisplay[m][7] = TableYanShi[(m + tx_i_show_row) * 2 + 1 - 32 + 96 + (I_display)*128];
        }
        tx_i_show_row_bak++;  // m=0-15,tx_i_show_row=0-15，特效显示分为上下半屏，从不同的4个字符取值
      }
    }
  };

  // 显示年月日，只有8行，(在下方)
  if (MyStyte3 == STATE_MYSTYTE3_BIGNYR && MyDisplay == STATE_MYDISPLAY_NORMAL) {
    // e0 e1 e2 e3  e5 e6 e7 e8 e9              e10 e11 e12         e13
    //  2  0  1  8   0  1  .  1  1  (年.月.日)    2   0   c (温度)   二 (星期)
    for (num = 0; num < 8; num++) {

      e5 = TableTempS[num + 7 * l_tmpdisplayNYR[4]];
      e6 = TableTempS[num + 7 * l_tmpdisplayNYR[5]];
      e7 = TableTempS[num + 7 * 12];  //.
      e8 = TableTempS[num + 7 * l_tmpdisplayNYR[6]];
      e9 = TableTempS[num + 7 * l_tmpdisplayNYR[7]];

      XdataDisplayR[num + 24][0] = e5 >> 4;
      XdataDisplayR[num + 24][1] = e6 >> 1 | e7 >> 6;
      XdataDisplayR[num + 24][2] = e8 | e9 >> 5;
      XdataDisplayR[num + 24][3] = e9 << 3;

      e10 = TableTempS[num + 7 * l_tmpdisplay[6]];  //显示温度和星期
      e11 = TableTempS[num + 7 * l_tmpdisplay[7]];
      e12 = TableTempS[num + 7 * 10];

      e13 = TableWeek[num + 7 * l_tmpdisplay[5]];

      XdataDisplayR[num + 24][4] = e13;
      XdataDisplayR[num + 24][5] = 0x00;

      XdataDisplayR[num + 24][6] = e10 | e11 >> 5;
      XdataDisplayR[num + 24][7] = e11 << 3 | e12 >> 2;
    }
  }

  // if (MyStyte3 == STATE_MYSTYTE3_SHEHUI3 && MyDisplay == STATE_MYDISPLAY_NORMAL) {  //上方8行显示小字时分秒：12:01:01
  //   // e0 e1 e2 e3 e5 e6 e7 e8
  //   //  2  0  :  1  5  :  0  1
  //   for (num = 0; num < 7; num++) {
  //     e0 = TableTempS[num + 7 * l_tmpdisplay[0]];
  //     e1 = TableTempS[num + 7 * l_tmpdisplay[1]];
  //     e2 = TableTempS[num + 7 * 13];
  //     e3 = TableTempS[num + 7 * l_tmpdisplay[3]];
  //     e5 = TableTempS[num + 7 * l_tmpdisplay[4]];
  //     e6 = TableTempS[num + 7 * 13];
  //     e7 = TableTempS[num + 7 * l_tmpdisplayNYR[0]];  //秒十位
  //     e8 = TableTempS[num + 7 * l_tmpdisplayNYR[1]];  //秒个位

  //     m = num + 1;  //向下移动一行
  //     XdataDisplayR[m][0] = e0 >> 4;
  //     XdataDisplayR[m][1] = e1 >> 1 | e2 >> 6;
  //     XdataDisplayR[m][2] = e3 | e5 >> 5;
  //     XdataDisplayR[m][3] = e5 << 3 | e6 >> 2 | e7 >> 4;
  //     XdataDisplayR[m][4] = e8 >> 1;
  //   }
  // }

  if (MyStyte3 == STATE_MYSTYTE3_SHEHUI3 && MyDisplay == STATE_MYDISPLAY_NORMAL) {
    for (num = 1; num < 14; num++) {  // 字模第一行留给社会4字，往下只到14行，防止溢出
      d0 = Tablehub[num + 14 * l_tmpdisplay[0]];
      d1 = Tablehub[num + 14 * l_tmpdisplay[1]];
      d2 = Tablehub[num + 14 * 10];
      d3 = Tablehub[num + 14 * l_tmpdisplay[3]];
      d4 = Tablehub[num + 14 * l_tmpdisplay[4]];
      d5 = Tablehub[num + 14 * 10];
      d6 = Tablehub[num + 14 * l_tmpdisplay[5]];  //秒十位
      d7 = Tablehub[num + 14 * l_tmpdisplay[6]];  //秒个位

      XdataDisplayR[num + 16][0] = d0 >> 2;  //左边空两列
      XdataDisplayR[num + 16][1] = d0 << 6 | d1 >> 2;
      XdataDisplayR[num + 16][2] = d1 << 6 | d2 >> 2;
      XdataDisplayR[num + 16][3] = d3;
      XdataDisplayR[num + 16][4] = d4;
      XdataDisplayR[num + 16][5] = d5 & 0xfc | d6 >> 6;
      XdataDisplayR[num + 16][6] = d6 << 2 | d7 >> 6;
      XdataDisplayR[num + 16][7] = d7 << 2;
    }
  }

  XdataDisplayR[31][0] = a0;  // 显示最后一行，进度条或空行或全亮
  XdataDisplayR[31][1] = a1;
  XdataDisplayR[31][2] = a2;
  XdataDisplayR[31][3] = a3;
  XdataDisplayR[31][4] = a4;
  XdataDisplayR[31][5] = a5;
  XdataDisplayR[31][6] = a6;
  XdataDisplayR[31][7] = a7;
}

/******************************************************************/
/*                 10ms定时子程序                                  */
/******************************************************************/
void IRAM_ATTR flash10MS()  // 10ms定时
{
  static uchar j, n;  // 静态变量，下次还能用

  TenMSec = true;  // 10ms

  static uchar m;
  m++;
  if (m >= 100) {
    m = 0;
    l_tmpgetdate[0]++;
    if (l_tmpgetdate[0] >= 60) {
      l_tmpgetdate[0] = 0;
      l_tmpgetdate[1]++;
      if (l_tmpgetdate[1] >= 60) {
        l_tmpgetdate[1] = 0;
        l_tmpgetdate[2]++;
        if (l_tmpgetdate[2] >= 24) {
          l_tmpgetdate[2] = 0;
          l_tmpgetdate[3]++;
          if (l_tmpgetdate[3] >= 7) {
            l_tmpgetdate[3] = 0;
          }
        }
      }
    }
  }

  // 主程序每10ms从RTC取时间，变量OneSec根据取得的秒参数设置
  if (l_tmplastsecend != l_tmpgetdate[0]) {
    OneSec = !OneSec;
    l_tmplastsecend = l_tmpgetdate[0];
  }

  F++;          // 全局变量，半秒闪烁标识
  if (F >= 50)  // 50*10=500ms，闪烁，使用标志位判断
  {
    F = 0;
    HafSec = !HafSec;

    j++;
    if (j >= 2) {  // 50*10*2=1000ms，1秒定时，使用标志位判断
      j = 0;

      n++;
      if (n >= 3) {  // 3s定时
        n = 0;

        if (MyDisplay == STATE_MYDISPLAY_WIFI)  // 3WIFI
        {
          I_display++;

          tx_b_show = true;   // 特效显示
          tx_i_show_row = 0;  // 从第一行开始

          if (I_display > (STATE_DISPLAY_WIFI_E)) {
            if (!WIFIOK) {
              // 无线不成功，继续显示WIFI
              I_display = STATE_DISPLAY_WIFI_B;
              tx_b_show = false;

            } else {
              I_display = 0;
              tx_b_show = false;

              MyDisplay = STATE_MYDISPLAY_NORMAL;
            }
          }
        }

        if (MyDisplay == STATE_MYDISPLAY_DEMO)  // 2演示状态
        {
          I_display++;

          tx_b_show = true;   // 特效显示
          tx_i_show_row = 0;  // 从第一行开始

          if (Always) {
            if (I_display > (STATE_DISPLAY_DEMO_MAX1)) {
              I_display = 0;      // 从头开始显示演示
              tx_b_show = false;  // 取消特效
            }
          } else {
            if (I_display > (STATE_DISPLAY_DEMO_MAX0)) {
              I_display = 0;
              tx_b_show = false;                   // 取消特效
              MyDisplay = STATE_MYDISPLAY_NORMAL;  // 只显示一次演示
              AutoSet = true;                      // 第一次显示时间之前，自动设置亮度
            }
          }
        }
      }
    }
  }
}

#endif